FROM centos
MAINTAINER wdm 605425512@qq.com
#设置容器使用用户
USER root
#设定变量
ARG nginx_name
ARG nginx_name_tar = $nginx_name".tar.gz"

RUN echo args are: $nginx_name $nginx_name_tar
#将当前目录的nginx考到镜像当中
ADD nginx_name_tar /usr/local

#RUN useradd -s /sbin/nologin -M nginx

WORKDIR /usr/local

RUN tar -zxvf $nginx_name_tar
RUN rm -rf $nginx_name_tar





#ENV RUN_USER nginx
#ENV RUN_GROUP nginx
#ENV DATA_DIR 
#ENV DATA_LOG /data/logs/nginx

#RUN 执行镜像支持的基础命令
#RUN mkdir /data/logs/nginx

#RUN chown nginx.nginx -R /data/logs/nginx

#镜像内创建目录
#ADD web /data/web

#ADD nginx.conf /etc/nginx/nginx.conf

#ADD default.conf /etc/nginx/conf.d/default.c
EXPOSE 80

ENTRYPOINT nginx -g "daemon off;"
